package com.itxiaoxiong.chat.mapper;

import com.itxiaoxiong.chat.pojo.SocketMap;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

import java.util.List;

@Mapper
public interface SocketMapMapper {

    @Insert("insert into socket_map (`key`) values (#{key})")
    void addSocket( @Param("key") String key);

    @Select("select `key` from socket_map where deleted = 0")
    List<String> getSocket();
    @Select("select `key` from socket_map where deleted = 0 and `key` = #{key}")
    List<String> getSocketByKey(@Param("key") String key);
}
